hint FRAGMENT_SQL_QUERY_BY_PAGE = true
hint FRAGMENT_SQL_QUERY_BY_PAGE_NUMBER_OFFSET = 1

var pageNavigate = (dataSet, pageSize, currentPage) -> {
    // 创建分页查询对象
    var pageQuery =  dataSet();

    // 设置分页信息
    run pageQuery.setPageInfo({
        "pageSize"    : pageSize,        // 页大小
        "currentPage" : currentPage      // 第1页
    });

    // 执行分页查询
    return {
        "total": pageQuery.pageInfo(),
        "list": pageQuery.data()
    }
}

return {
    "pageNavigate": pageNavigate
}